package com.rocker.graduation.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.rocker.graduation.dao.CategoryMapper;
import com.rocker.graduation.dao.UserMapper;
import com.rocker.graduation.domain.Category;
import com.rocker.graduation.util.FileUtils;

@Service
public class testService {
	@Autowired
	private UserMapper userMapper;
	
	@Autowired
	private CategoryMapper categoryMapper;
	public void test(){
		Category category = new Category();
		category.setCategoryEntity(FileUtils.file2ByteArray("C:\\Users\\rockeche\\Downloads\\test.jpg"));
		category.setCategoryId(1);
		int i = categoryMapper.insertSelective(category);
		System.out.println(i);
	}
	
	public Category getByteArray(){
		return categoryMapper.selectByPrimaryKey(1);
	}
}
